/* Custom UI stacking order */
.codex-header {
    z-index: 990 !important;
}

.codex-sidebar {
    z-index: 995 !important;
    position: absolute !important;
    height: auto !important;
    min-height: 100vh;
}

/* Fix sidebar scrolling - allow it to scroll with page */
.codex-sidebar .codex-menuwrapper {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}

.codex-sidebar .codex-menu {
    max-height: none !important;
    overflow-y: visible !important;
}

.modal-backdrop {
    z-index: 1040 !important;
    /* below modals */
}

.modal {
    z-index: 1050 !important;
    /* base modal */
}

/* Policy specific modal higher than generic modals and SweetAlert */
.policy-modal {
    z-index: 1065 !important;
}

.policy-modal .modal-dialog {
    z-index: 1066 !important;
    position: relative;
}

.policy-modal .modal-content {
    z-index: 1067 !important;
    position: relative;
}

/* Ensure modal backdrops don't interfere */
.modal-backdrop.show {
    z-index: 1040 !important;
}

/* Force all modals above sidebar/header */
body .modal,
body .modal.show {
    z-index: 1050 !important;
}

body .policy-modal,
body .policy-modal.show {
    z-index: 1065 !important;
}